﻿
cmake_minimum_required(VERSION 3.14)

# fmt
#add_subdirectory(fmt/fmt-8.0.1)

#enable_testing()
#set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
#add_subdirectory(googletest)

include(FetchContent)
FetchContent_Declare(fmt
  URL ${PROJECT_SOURCE_DIR}/contrib/fmt/fmt-10.2.1.zip
)
FetchContent_MakeAvailable(fmt)

# 设置FetchContent_Declare产生的变量为内部变量
set(FETCHCONTENT_SOURCE_DIR_FMT ${FMT_SOURCE_DIR} CACHE INTERNAL "")
set(FETCHCONTENT_BINARY_DIR_FMT ${FMT_BINARY_DIR} CACHE INTERNAL "")
#set(GTEST_HAS_ABSL ${GTEST_HAS_ABSL} CACHE INTERNAL "")#

FetchContent_Declare(googletest
  URL ${PROJECT_SOURCE_DIR}/contrib/googletest/googletest-1.14.0.zip
)
FetchContent_MakeAvailable(googletest)

FetchContent_Declare(json
  URL ${PROJECT_SOURCE_DIR}/contrib/nlohmann_json/json-3.11.3.zip
)
FetchContent_MakeAvailable(json)

FetchContent_Declare(yaml-cpp
  URL ${PROJECT_SOURCE_DIR}/contrib/yaml-cpp/yaml-cpp-0.8.0.zip
)
FetchContent_MakeAvailable(yaml-cpp)

#FetchContent_Declare(eigen
#  URL ${PROJECT_SOURCE_DIR}/contrib/eigen/eigen-3.4.0.zip
#)
#FetchContent_MakeAvailable(eigen)
#set(EIGEN_BUILD_DOC OFF)
#set(BUILD_TESTING OFF)
#set(EIGEN_BUILD_PKGCONFIG OFF)

#add_subdirectory(getpot)
add_subdirectory(libmesh)